﻿using System;
using System.Collections.Generic;
using System.Text;
using ebay.Utility;
using eBay.Service.Core.Soap;
using ebay.Dal;
using System.Data;
using ebay.ebayApi;

namespace ebay.BLL
{
   public class Item
    {

       public ItemType GetItem(string ItemId, string token)
       {
           try
           {
               ebayCallsApi apiCall = new ebayCallsApi(token);
               return apiCall.GetItem(ItemId);
           }
           catch
           {
               return null;
           }
       }
       /// <summary>
       /// 修改商品属性 修改价格使用 Item.ReservePrice.Value
       /// </summary>
       /// <param name="ItemId"></param>
       /// <param name="token"></param>
       /// <returns></returns>
       //public double ReviseItem(ItemType Item, string token)
       public DateTime ReviseItem(ItemType Item, string token, ref double listing_Fee)
       { 
           ebayCallsApi apiCall = new ebayCallsApi(token);
           try
           {
               return apiCall.ReviseItem(Item,ref listing_Fee);               
           }
           catch
           {
               return DateTime .Now;             
           }
       }
       public string EndItem(ItemType Item, string token)
       {
           ebayCallsApi apiCall = new ebayCallsApi(token);
           try
           {

               string result = apiCall.EndItem(Item);
               return result;
           }
           catch
           {
               return "";
           }
       
       }
    }    
}
